package fr.ece.ing4.si.montecarloapplication;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import fr.ece.ing4.si.gui.MainPanel;
import fr.ece.ing4.si.gui.MainWindow;


public class Main {
	
	public static ArrayList<SetOfArguments> readArguments() throws IOException {
		
		final BufferedReader reader = new BufferedReader(new FileReader("arguments.txt"));
		
		final ArrayList<SetOfArguments> tableOfArguments = new ArrayList<>();

		String stockArguments = null;
		
		while ((stockArguments = reader.readLine()) != null) {
			final String[] stockArgumentsData = stockArguments.split(",");
			
			tableOfArguments.add(new SetOfArguments(stockArgumentsData));
		}
 
		return tableOfArguments;
	}
	

	public static void main(String[] args) throws IOException {
		
		ArrayList<SetOfArguments> tableOfArguments = new ArrayList<>();
		
		tableOfArguments = readArguments();
		
		MainPanel mainPanel = new MainPanel(tableOfArguments);
		mainPanel.tabsOrganisation();
		
		MainWindow mainWindow = new MainWindow(mainPanel);
		mainWindow.configureMenu();
		mainWindow.configureWindow();

	}

}
